﻿@{
    ViewBag.Title = "UserGroupChange";
}

@model PhoneBook.Models.Contacts.UserGroupChangeModel
<h2>UserGroupChange</h2>



<form action="@Url.Action("SearchUserGroup", "Contact")">
    <input type="text" name="searchUserGroupKey" />
    <input type="submit" value="查询" />
</form>


<a href="@Url.Action("CreateUserGroup","UserGroups")">创建用户组</a>

<form action="@Url.Action("ChangeUserGroup", "Contact")" method="POST">

    @foreach (var ug in Model.SelectedUserGroups)
    {
        <input type="checkbox" name="SelectedUserGroupsIds" @if (ug.Checked)
                                       {<text>checked="checked"</text>} value="@ug.UserGroupId"/> 
        <span>@ug.GroupName</span>
    }
    
    @Html.HiddenFor(model=>model.ContactId)
    <input type="submit" value="保存" />

</form>


<script>
    $(function () {
        $('#searchUserGroup').click(function () {

        });
    });
</script>
